]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ci: Ensure eslint output exists
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 14 Aug 2019 11:14:23 +0000 (13:14 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 16 Oct 2019 15:37:12 +0000 (15:37 +0000)
We are a long time away from an error-free eslint run,
but when we get there eventually, let's not trip over
non-existent files ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/730

.gitlab-ci/run-eslint.sh

index ae4aee979fdcf8c5e6a3499bd41e18a11c6d85e5..edcdfc1fd80534c1fae2d7c9358fa39361875a52 100755 (executable)
@@ -16,8 +16,14 @@ run_eslint() {
   ARGS_LEGACY='--config lint/eslintrc-legacy.json'
 
   local extra_args=ARGS_$1
-  local output=OUTPUT_$1
-  eslint -f unix ${!extra_args} -o ${!output} js
+  local output_var=OUTPUT_$1
+  local output=${!output_var}
+
+  # ensure output exists even if eslint doesn't report any errors
+  mkdir -p $(dirname $output)
+  touch $output
+
+  eslint -f unix ${!extra_args} -o $output js
 }
 
 list_commit_range_additions() {